﻿/*
 *	Advenced Recent Posts Scroller Version 3 For Blogger
 *	Widget By Online Computer Institute
 *	Url: http://www.adhikarikedar.blogspot.com
 *	Copyright   2013, by Kedar adhikari (Online Computer Institute)
 */

function kdrAdvRecentPostsScrollerv3(json) {
	var kdrrecentposts;
	var kdrpostlink;
	var kdrobj;
	var kdrmarqueehtml;
	var kdrmarqueehtml2;
	var byOnlineComputerInstitute;
	var kdrlinkgap;
	var kdrposttargetlink;
	var kdrBullet;
	try {
		kdrmarqueehtml = "\<marquee behavior=\"scroll\" onmouseover=\"this.stop();\" onmouseout=\"this.start();\" ";

		if (kdrScrollAmount) {
			kdrmarqueehtml = kdrmarqueehtml + " scrollamount = \"" + kdrScrollAmount + "%\"";
		} 
		if (kdrWidth) {
			kdrmarqueehtml = kdrmarqueehtml + " width = \"" + kdrWidth + "%\"";
		} else {
			kdrmarqueehtml = kdrmarqueehtml + " width = \"100%\"";
		}
		if (kdrScrollDelay) {
			kdrmarqueehtml = kdrmarqueehtml + " scrolldelay = \"" + kdrScrollDelay + "\"";
		}
		if (kdrDirection) {
			kdrmarqueehtml = kdrmarqueehtml + " direction = \"" + kdrDirection + "\"\>";
			if (kdrDirection == "left" || kdrDirection == "right") {
				kdrlinkgap = "&nbsp;&nbsp;&nbsp;";
			} else {
				kdrlinkgap = "\<br/\>";
			}
		}
		if (kdrtargetlink == "yes") {
			kdrposttargetlink = " target= \"_blank\" ";
		} else {
			kdrposttargetlink = " ";
		}
		if (kdrimagebullet == "yes") {
			kdrBullet = " \<img class=\"kdrbulletbimg\" src=\"" + kdrimgurl + "\" />";
		} else {
			kdrBullet = kdrBulletchar;
		}
		kdrmarqueehtml2 = "\</marquee\>"
		kdrrecentposts = "";
		for (var kdrrp = 0; kdrrp < kdrnumPosts; kdrrp++) {
			var kdrobj = json.feed.entry[kdrrp];
			if (kdrrp == json.feed.entry.length) break;
			for (var kdrcc = 0; kdrcc < kdrobj.link.length; kdrcc++) {
				if (kdrobj.link[kdrcc].rel == 'alternate') {
					kdrpostlink = kdrobj.link[kdrcc].href;
					break;
				}
			}
			kdrrecentposts = kdrrecentposts + kdrBullet + " \<a " + kdrposttargetlink + " href=\"" + kdrpostlink + "\">" + kdrobj.title.$t + "\</a\>" + kdrlinkgap;
		}
		byOnlineComputerInstitute = "\<a tareget =\"_blank\" href=\"http://adhikarikedar.blogspot.com\"\>Get This\</a\> \<a tareget =\"_blank\" href=\"http://adhikarikedar.blogspot.com/\"\>\</a\>";
		if (kdrDirection == "left") {
			kdrrecentposts = kdrrecentposts + "&nbsp;&nbsp;&nbsp;" + byOnlineComputerInstitute;
		} else if (kdrDirection == "right") {
			kdrrecentposts = byWay2blogging + "&nbsp;&nbsp;&nbsp;" + kdrrecentposts;
		} else if (kdrDirection == "up") {
			kdrrecentposts = kdrrecentposts + "\<br/\>" + byOnlineComputerInstitute;
		} else {
			kdrrecentposts = byOnlineComputerInstitute + "\<br/\>" + kdrrecentposts;
		}
		document.write("\<style style=\"text/css\"\>.OnlineComputerInstitute-srp{font-size:" + kdrfontsize + "px;background:#" + kdrbgcolor + ";font-weight:bold;}.OnlineComputerInstitute-srp a{color:#" + kdrlinkcolor + ";text-decoration:none;}.OnlineComputerInstitute-srp a:hover{color:#" + kdrlinkhovercolor + ";}img.kdrbulletbimg{vertical-align:middle;border:none;}\</style\>")
		document.write("\<div class=\"OnlineComputerInstitute-srp\"\>" + kdrmarqueehtml + kdrrecentposts + kdrmarqueehtml2 + "\</div\>")
	} catch (exception) {
		alert(exception);
	}
}

